<template>
  <el-dialog
    title="详情"
    :visible.sync="dialogVisible"
    width="1000px">
    <el-table
      :data="dataList"
      border
      ref="singleTable"
      highlight-current-row
      :header-cell-style="{background:'#17b3a3',color:'#FFFFFF'}"
      v-loading="dataListLoading"
      style="width: 100%;">
      <el-table-column
        prop="areaId"
        header-align="center"
        align="center"
        label="区域编号">
      </el-table-column>
      <el-table-column
        prop="areaName"
        header-align="center"
        align="center"
        label="区域名称">
      </el-table-column>
      <el-table-column
        prop="lableId"
        header-align="center"
        align="center"
        label="人员编号">
      </el-table-column>
      <el-table-column
        prop="empName"
        header-align="center"
        align="center"
        label="人员姓名">
      </el-table-column>
      <el-table-column
        prop="alarmTime"
        header-align="center"
        align="center"
        label="报警时间">
      </el-table-column>
    </el-table>
  </el-dialog>
</template>

<script>
export default {
  name: 'detaildata',
  data(){
    return {
      dataForm: {
        key: '',
        areaId: ''
      },
      datajson: [],
      dataList: [],
      pageIndex: 1,
      pageSize: 10,
      totalPage: 0,
      dataListLoading: false,
      dataListSelections: [],
      addOrUpdateVisible: false,
      Visiable: false,
      dialogVisible:false,
      aa: false,
      area: {
        area1: ''
      }
    }
  },
  methods:{
    init(areaId){
      this.dialogVisible = true;
      console.log('子组件eid为' + areaId)
      // console.log('子组件ename为' + areaId)
      this.dataForm.areaId = areaId;
      this.$http({
        url: this.$http.adornUrl('/area/area/listAreaDetail'),
        method: 'get',
        async: false,
        params: this.$http.adornParams({
          'page': this.pageIndex,
          'limit': this.pageSize,
          'areaId': this.dataForm.areaId
        })
      }).then(({data}) => {
        console.log(data)
        if(data){
          this.dataList = data.page.records;
          this.totalPage = data.page.total;
        }else {
          this.dataList = []
          this.totalPage = 0
        }
        this.dataListLoading = false
      })
    }
  }
}
</script>

<style scoped>

</style>
